//
//  NRWCarDetailSellerInfoCell.m
//  NRWMall
//
//  Created by 张记 on 2018/5/22.
//  Copyright © 2018年 com.anpxd. All rights reserved.
//

#import "NRWCarDetailSellerInfoCell.h"

@interface NRWCarDetailSellerInfoCell ()
@property (weak, nonatomic) IBOutlet UILabel *mainTitle;
@property (weak, nonatomic) IBOutlet UILabel *subtitle;
@end

@implementation NRWCarDetailSellerInfoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(void)setIndex:(NSIndexPath *)index{
    _index = index;
}
-(void)setShopModel:(shopInfoModel *)shopModel{
    _shopModel = shopModel;
    self.mainTitle.textColor = getColor(@"323232");
    self.subtitle.text = @"";
    if (_index.row == 0) {
        self.mainTitle.text = shopModel.shopName;
        self.subtitle.text = shopModel.market.marketName;
    }else if (_index.row == 1){
        self.mainTitle.text = shopModel.shopAddress;
    }
}
-(void)setMobile:(NSString *)mobile{
    _mobile = mobile;
    if (_index.row == 2) {
        NSString *phoneStr;
        if ([DataCheck valiMobile:mobile] == YES) {
            phoneStr = [mobile stringByReplacingOccurrencesOfString:@"(\\d{3})(\\d{4})(\\d{4})" withString:@"$1-$2-$3" options:NSRegularExpressionSearch range:NSMakeRange(0, [mobile length])];
        }else{
            phoneStr = mobile;
        }
        self.mainTitle.text = phoneStr;
        self.mainTitle.textColor = mainColor();
    }
}
@end
